@adminAndLogin.main(""){

  <div class="col-sm-12">
    <section class="main-col" style="margin: 0 auto;">
      <div class="register">
        <h2 class="page-heading" style="font-size: 25px;">注册账户</h2>
        <form id="loginForm" style="max-width: 320px;" class="registration-form" accept-charset="UTF-8"  action="/home/signSuccess">

          <div class="form-group">
            <div class="input-group">
              <span class="input-group-addon"><em
              class="fa fa-user icon2x"></em>
              </span>
              <input id="account" name="account" placeholder="账号" autofocus="autofocus" type="text" class="form-control" required value=""/>
            </div>
          </div>

          <div class="form-group">
            <div class="input-group">
              <span class="input-group-addon"><em
              class="fa fa-key icon2x"></em>
              </span>
              <input id="password" name="password" placeholder="密码" type="password" autofocus="autofocus" class="form-control" required value="" maxlength="30"/>
            </div>
          </div>

          <div class="form-group">
            <div class="input-group">
              <span class="input-group-addon"><em
              class="fa fa-key icon2x"></em>
              </span>
              <input id="password2" name="password2" placeholder="再次密码" type="password" autofocus="autofocus" class="form-control" required value="" maxlength="30"/>
            </div>
          </div>


          <div class="form-group">
            <div class="input-group">
              <span class="input-group-addon"><em
              class="fa fa-check icon2x"></em>
              </span>
              <input type = "text" id = "validnumber" name="validnumber" placeholder="验证码" autofocus="autofocus" class="form-control" required style="width: 200px;"/>
              <input type = "button" id="code" onclick="createCode()"style="width: 60px;height: 42px;margin-left: 5px" id = "number" name="number" />
            </div>
          </div>

          <div class="actions">
              <button type="submit" class="btn btn-primary" style="width: 320px;height: 46px" id="search">注 册</button>
          </div>
        </form>
      </div>
    </section>
  </div>



  <script>

          var code ; //在全局定义验证码
          //产生验证码
          window.onload = function createCode() {
              code = "";
              var codeLength = 4;//验证码的长度
              var checkCode = document.getElementById("code");
              var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);//随机数
              for (var i = 0; i < codeLength; i++) {//循环操作
                  var index = Math.floor(Math.random() * 10);//取得随机数的索引（0~35）
                  code += random[index];//根据索引取得随机数加到code上
              }
              checkCode.value = code;//把code值赋给验证码
          }

          function createCode() {
              code = "";
              var codeLength = 4;//验证码的长度
              var checkCode = document.getElementById("code");
              var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);//随机数
              for (var i = 0; i < codeLength; i++) {//循环操作
                  var index = Math.floor(Math.random() * 10);//取得随机数的索引（0~35）
                  code += random[index];//根据索引取得随机数加到code上
              }
              checkCode.value = code;//把code值赋给验证码
          }

          $(function () {
              formValidation();
          })


          function formValidation() {
              $('#loginForm').formValidation({
                  framework: 'bootstrap',
                  icon: {
                      valid: 'glyphicon glyphicon-ok',
                      invalid: 'glyphicon glyphicon-remove',
                      validating: 'glyphicon glyphicon-refresh'
                  },
                  fields: {
                      account: {
                          validators: {
                              notEmpty: {
                                  message: '用户名不能为空!'
                              },
                              regexp: {
                                  regexp: '^[A-Za-z0-9"_"]{1,250}$',
                                  message: '请不要输入特殊字符,！'
                              },
                              stringLength: {
                                  message: '用户名长度最大为20！',
                                  max: 20
                              },
                              remote: {
                                  type: 'POST',
                                  url: '/home/checkAccount',
                                  delay: 2000
                              }
                          }
                      },
                      password: {
                          validators: {
                              notEmpty: {
                                  message: "请输入密码！"
                              },
                              stringLength: {
                                  min: 6,
                                  message:"最少输入6位数密码！"
                              },
                          }
                      },
                      password2: {
                          validators: {
                              notEmpty: {
                                  message: "请再次输入密码！"
                              },
                              identical: {
                                  field: 'password',
                                  message: '与您输入的密码不一致!'
                              }
                          }
                      },
                      validnumber: {
                          validators: {
                              notEmpty: {
                                  message: "请输入验证码！"
                              },
                              callback: {
                                  message: '验证码错误！',
                                  callback: function() {
                                      var inputCode = document.getElementById("validnumber").value; //取得输入的验证码并转化为大写
                                      if (inputCode != code) { //若输入的验证码与产生的验证码不一致时
                                          return false;
                                      }else{
                                          return true;
                                      }
                                      return false;
                                  }
                              },
                          }
                      },
                  }
              });
          }



  </script>
          }